package com.gears_software.sxdc.dccx.ui.activity;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import android.widget.ImageView;

import com.gears_software.sxdc.dccx.R;
import com.gears_software.sxdc.dccx.data.sharedPreference.DCCXSp_;
import com.umeng.message.inapp.InAppMessageManager;
import com.umeng.message.inapp.UmengSplashMessageActivity;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Background;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.WindowFeature;
import org.androidannotations.annotations.sharedpreferences.Pref;

/**
 * Created by lileltp on 2017/8/19.
 */

@EActivity(R.layout.activity_splash)
public class SplashActivity extends Activity {


    @Pref
    DCCXSp_ sp;

    @AfterViews
    void created() {
        goHome();
    }

    @Background(delay = 3000)
    void goHome() {
        showResult();
    }

    @UiThread
    void showResult() {
        boolean firstFlag = sp.isFirst().get();
        if (firstFlag) {
            Intent intent = new Intent(this, Intro.class);
            startActivity(intent);
            finish();

        } else {
            Intent intent = new Intent(this, MainActivity_.class);
            startActivity(intent);
            this.finish();
        }
//        Intent intent = new Intent(this, TestActivity_.class);
//        startActivity(intent);
    }

}
